/*
* chartType: 0-线图，1-柱图，2-表格，3-数值
* windowSize: 0-小，1-中，2-大
* type: 0-事件分析，1-漏斗，2-留存，3-分布，4-LTV，5-属性，6-归因，7-间隔，8-用户路径，9-渠道对比
* */

// 无分组、无对比时间
let queryJsonInit = {
	"messures": [
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数01",
			"filter": {}
		},
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数02"
		},
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数03"
		}
	],
	searchTime: {
		"unit": "day",
		startDate: "2021-05-01",
		endDate: "2021-05-15",
	},
	"byFields": [],
	"detail_and_rollup": true,
	"enable_detail_follow_rollup_by_values_rank": true,
	"sub_task_type": "SEGMENTATION",
	"time_zone_mode": "",
	"server_time_zone": "",
	"trade_day_mode": "",
	"filter": {
		"filters": [
			{
				"$$render_index": 2,
				"conditions": [
					{
						"field": "event.$Anything.$province",
						"function": "equal",
						"params": [
							"北京"
						],
						"$$searchValue": "省份",
						"$$render_index": 8
					},
					{
						"field": "event.$Anything.$os",
						"function": "equal",
						"params": [
							"iOS",
							"Android"
						],
						"$$render_index": 9
					}
				],
				"relation": "or"
			}
		],
		"relation": "and"
	},
	"bucket_params": {},
	"chartType": 1,
	"layer_other_rollup": false,
	"bookmarkid": 44904,
	"include_today": true,
	"jump_url": "",
	"request_id": "1619514103077:520979",
	"use_cache": true
};
// 有分组、对比时间
let queryJsonCom = {
	"messures": [
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数01",
			"filter": {}
		},
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数02"
		}
	],

	searchTime: {
		"unit": "day",
		contrastStartDate: "2021-04-01",
		contrastEndDate: "2021-04-04",
		startDate: "2021-05-01",
		endDate: "2021-05-15",
	},
	"byFields": [
		{
			commonType: null,
			dataType: "字符串",
			hasDict: 1,
			id: 28,
			productCode: "wz",
			properType: 1,
			propertyId: "c9",
			propertyName: "按钮名称"
		},
		{
			commonType: null,
			dataType: "数值",
			hasDict: 1,
			id: 29,
			productCode: "wz",
			properType: 1,
			propertyId: "c10",
			propertyName: "按钮位置"
		},
	],
	"detail_and_rollup": true,
	"enable_detail_follow_rollup_by_values_rank": true,
	"sub_task_type": "SEGMENTATION",
	"time_zone_mode": "",
	"server_time_zone": "",
	"trade_day_mode": "",
	"filter": {
		"filters": [
			{
				"$$render_index": 2,
				"conditions": [
					{
						"field": "event.$Anything.$province",
						"function": "equal",
						"params": [
							"北京"
						],
						"$$searchValue": "省份",
						"$$render_index": 8
					},
					{
						"field": "event.$Anything.$os",
						"function": "equal",
						"params": [
							"iOS",
							"Android"
						],
						"$$render_index": 9
					}
				],
				"relation": "or"
			}
		],
		"relation": "and"
	},
	"bucket_params": {},
	"chartType": "line",
	"layer_other_rollup": false,
	"bookmarkid": 44904,
	"include_today": true,
	"jump_url": "",
	"request_id": "1619514103077:520979",
	"use_cache": true
};
// 有分组、无对比时间
let queryJsonFields = {
	"messures": [
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数01",
			"filter": {}
		},
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数02"
		},
		{
			"event_name": "$AppClick",
			"aggregator": "general",
			"name": "App 元素点击的总次数03"
		}
	],
	searchTime: {
		"unit": "day",
		startDate: "2021-05-01",
		endDate: "2021-05-15",
	},
	"byFields": [
		{
			commonType: null,
			dataType: "字符串",
			hasDict: 1,
			id: 28,
			productCode: "wz",
			properType: 1,
			propertyId: "c9",
			propertyName: "按钮名称"
		},
		{
			commonType: null,
			dataType: "数值",
			hasDict: 1,
			id: 29,
			productCode: "wz",
			properType: 1,
			propertyId: "c10",
			propertyName: "按钮位置"
		},
	],
	"detail_and_rollup": true,
	"enable_detail_follow_rollup_by_values_rank": true,
	"sub_task_type": "SEGMENTATION",
	"time_zone_mode": "",
	"server_time_zone": "",
	"trade_day_mode": "",
	"filter": {
		"filters": [
			{
				"$$render_index": 2,
				"conditions": [
					{
						"field": "event.$Anything.$province",
						"function": "equal",
						"params": [
							"北京"
						],
						"$$searchValue": "省份",
						"$$render_index": 8
					},
					{
						"field": "event.$Anything.$os",
						"function": "equal",
						"params": [
							"iOS",
							"Android"
						],
						"$$render_index": 9
					}
				],
				"relation": "or"
			}
		],
		"relation": "and"
	},
	"bucket_params": {},
	"chartType": "line",
	"layer_other_rollup": false,
	"bookmarkid": 44904,
	"include_today": true,
	"jump_url": "",
	"request_id": "1619514103077:520979",
	"use_cache": true
};

const state = {
	// 数据概览看板变量
	// card_arr: [
	// 	{
	// 		id: "5",
	// 		windowSize: 0,
	// 		chartType: 3,
	// 		type: 0,
	// 		queryJson: JSON.stringify(queryJsonInit),
	//
	// 		hb: 12.3,
	// 		tb: 1.97,
	// 		num: 423,
	// 		name: "全站流量",
	// 		bz: '....'
	// 	},
	// 	{
	// 		id: "6",
	// 		windowSize: 0,
	// 		chartType: 3,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$WebStay\",\"aggregator\":\"general\",\"name\":\"Web 视区停留的总次数\"},{\"event_name\":\"visit_xn\",\"aggregator\":\"general\",\"name\":\"全站流量的总次数\"}],\"from_date\":\"2021-05-07\",\"to_date\":\"2021-05-18\",\"unit\":\"day\",\"byFields\":[\"event.$Anything.$resume_from_background\",\"event.$Anything.$event_duration\"],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]},\"bucket_params\":{},\"compare_from_date\":null,\"compare_to_date\":null,\"bookmarkid\":55960,\"request_id\":\"1621321356771:534979\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonFields),
	//
	// 		hb: -8.3,
	// 		tb: 2.97,
	// 		num: 523,
	// 		name: "全站日活",
	// 		bz: 'rretdsfadfa'
	// 	},
	// 	{
	// 		id: "10",
	// 		windowSize: 1,
	// 		chartType: 1,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$WebStay\",\"aggregator\":\"general\",\"name\":\"Web 视区停留的总次数\"},{\"event_name\":\"visit_xn\",\"aggregator\":\"general\",\"name\":\"全站流量的总次数\"}],\"from_date\":\"2021-05-07\",\"to_date\":\"2021-05-18\",\"unit\":\"day\",\"byFields\":[\"event.$Anything.$resume_from_background\",\"event.$Anything.$event_duration\"],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]},\"bucket_params\":{},\"compare_from_date\":null,\"compare_to_date\":null,\"bookmarkid\":55960,\"request_id\":\"1621321356771:534979\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonFields),
	//
	// 		hb: 42.3,
	// 		num: 346,
	// 		tb: -3.97,
	// 		name: "过去七日新访问用户数",
	// 		bz: '4354453'
	// 	},
	// 	{
	// 		id: "7",
	// 		windowSize: 2,
	// 		chartType: 2,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$WebStay\",\"aggregator\":\"general\",\"name\":\"Web 视区停留的总次数\"},{\"event_name\":\"visit_xn\",\"aggregator\":\"general\",\"name\":\"全站流量的总次数\"}],\"from_date\":\"2021-05-07\",\"to_date\":\"2021-05-18\",\"unit\":\"day\",\"byFields\":[\"event.$Anything.$resume_from_background\",\"event.$Anything.$event_duration\"],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]},\"bucket_params\":{},\"compare_from_date\":null,\"compare_to_date\":null,\"bookmarkid\":55960,\"request_id\":\"1621321356771:534979\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonFields),
	//
	// 		hb: 9.62,
	// 		num: 74,
	// 		tb: 3.43,
	// 		name: "注册用户数",
	// 		bz: 'asewrewr'
	// 	},
	// 	{
	// 		id: "1",
	// 		windowSize: 1,
	// 		chartType: 2,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]}}],\"from_date\":\"2021-05-01\",\"to_date\":\"2021-05-19\",\"unit\":\"day\",\"byFields\":[],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"chartType\":\"line\",\"bucket_params\":{},\"bookmarkid\":56137,\"request_id\":\"1621418037815:162780\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonInit),
	//
	// 		hb: -19.3,
	// 		tb: 3.97,
	// 		num: 321,
	// 		name: "GMV",
	// 		bz: 'jhkkadsad'
	// 	},
	// 	{
	// 		id: "11",
	// 		windowSize: 2,
	// 		chartType: 1,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]}}],\"from_date\":\"2021-05-01\",\"to_date\":\"2021-05-19\",\"compare_to_date\":\"2021-04-04\",\"unit\":\"day\",\"byFields\":[],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"chartType\":\"line\",\"bucket_params\":{},\"compare_from_date\":\"2021-04-01\",\"request_id\":\"1621505360951:211378\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonCom),
	//
	// 		hb: -19.3,
	// 		tb: 3.97,
	// 		num: 321,
	// 		name: "GMV",
	// 		bz: 'jhkkadsad'
	// 	},
	// 	{
	// 		id: "9",
	// 		windowSize: 2,
	// 		chartType: 0,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$WebStay\",\"aggregator\":\"general\",\"name\":\"Web 视区停留的总次数\"},{\"event_name\":\"visit_xn\",\"aggregator\":\"general\",\"name\":\"全站流量的总次数\"}],\"from_date\":\"2021-05-07\",\"to_date\":\"2021-05-18\",\"unit\":\"day\",\"byFields\":[\"event.$Anything.$resume_from_background\",\"event.$Anything.$event_duration\"],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]},\"bucket_params\":{},\"compare_from_date\":null,\"compare_to_date\":null,\"bookmarkid\":55960,\"request_id\":\"1621321356771:534979\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonFields),
	//
	// 		hb: 122.3,
	// 		num: 34,
	// 		tb: 4.7,
	// 		name: "过去七日活",
	// 		bz: '2133213'
	// 	},
	// 	// //
	// 	{
	// 		id: "2",
	// 		time: "2020-02-13 至 2020-05-01",
	// 		windowSize: 1,
	// 		chartType: 0,
	// 		type: 0,
	// 		// queryJson: "{\"messures\":[{\"event_name\":\"$Anything\",\"aggregator\":\"general\",\"name\":\"任意事件的总次数\"},{\"event_name\":\"$WebStay\",\"aggregator\":\"general\",\"name\":\"Web 视区停留的总次数\"},{\"event_name\":\"visit_xn\",\"aggregator\":\"general\",\"name\":\"全站流量的总次数\"}],\"from_date\":\"2021-05-07\",\"to_date\":\"2021-05-18\",\"unit\":\"day\",\"byFields\":[\"event.$Anything.$resume_from_background\",\"event.$Anything.$event_duration\"],\"detail_and_rollup\":true,\"enable_detail_follow_rollup_by_values_rank\":true,\"sub_task_type\":\"SEGMENTATION\",\"time_zone_mode\":\"\",\"server_time_zone\":\"\",\"filter\":{\"conditions\":[{\"field\":\"event.$Anything.$resume_from_background\",\"function\":\"isTrue\",\"params\":[],\"$$render_index\":2}]},\"bucket_params\":{},\"compare_from_date\":null,\"compare_to_date\":null,\"bookmarkid\":55960,\"request_id\":\"1621321356771:534979\",\"use_cache\":true,\"dashboard_id\":12714}",
	// 		queryJson: JSON.stringify(queryJsonFields),
	//
	// 		hb: 12.3,
	// 		tb: -33.21,
	// 		num: 643,
	// 		name: "订单量",
	// 		bz: 'vvfsdfdsf'
	// 	}
	// ],
	card_arr: [
		// {
		// 	id: 1,
		// 	windowSize: 1,
		// 	chartType: 4,
		// 	name: "订单量",
		// 	queryJson: JSON.stringify(queryJsonFields)
		// },
		// {
		// 	id: 2,
		// 	windowSize: 1,
		// 	chartType: 4,
		// 	queryJson: JSON.stringify(queryJsonCom)
		// }
	],
	queryJsonInit,
	queryJsonCom,
	queryJsonFields
};
const mutations = {
	/* 数据概览 */
	card_arr_change(state, value) {
		state.card_arr = value;
	},
};
const actions = {
	/* 数据概览 */
};
const getters = {};

export default {
	namespaced: true,
	state,
	mutations,
	actions,
	getters
};
